<?php 
require("../core.php");
$dtitle = "七天学会NodeJS-";
require("../include/head.php");
?>
<style>
body {
color: #333;
font-family: sans-serif;
font-size: 12pt;
line-height: 170%;
}

header .banner {
margin: 0 0 1em 0;
}

header .banner, nav .banner {
color: #777;
font-size: 10pt;
font-weight: bold;
}

header h1 {
background: #0c3;
border-radius: 4px;
color: #fff;
font-size: 24pt;
margin: 0;
padding: 1.2em 0;
text-align: center;
width:700px;float:left;
}

nav {
font-size: 10pt;
overflow-x: hidden;
overflow-y: auto;
height:800px;width: 240px;float:left;margin-right:10px;
}

nav .menubar {
border-bottom: solid 1px #ccc;
display: none;
height: 48px;
line-height: 48px;
padding: 0 10px;
}

nav .button {
background: #777;
border: 1px solid #333;
color: #fff;
font-size: 10pt;
font-weight: bold;
padding: 8px;
border-radius: 4px;
}

nav ul {
padding: 0 0 0 10px;
}

nav ul a {
color: #333;
text-decoration: none;
}

nav ul a:hover {
text-decoration: underline;
}

nav li {
line-height: 180%;
list-style: none;
margin: 0;
padding: 0;
}

nav .level2 {
font-size: 11pt;
font-weight: bold;
}

nav .level3 {
padding-left: 1em;
}

nav .level3:before { 
content: "» ";
}

nav .level4 {
padding-left: 2em;
}

nav .level4:before {
content: "› ";
}

article h2 {
border-bottom: dotted 1px #777;
font-size: 12pt;
line-height: 100%;
margin: 4em 0 1em 0;
padding: 0 0 0.3em 0;
}

article h3 {
font-size: 12pt;
line-height: 100%;
margin: 2em 0 1em 0;
padding: 0;
}

article h4 {
font-size: 12pt;
font-style:italic;
font-weight: normal;
line-height: 100%;
margin: 1.2em 0 1em 0;
padding: 0;
}

article p {
margin: 1em 0;
}

article p code {
background: #eee;
border: 1px solid #ccc;
}

article p strong {
color: #f00;
}

article pre {
background: #eee;
border-left: solid 2px #3c0;
font-size: 10pt;
margin: 1em 0;
padding: 0 0 0 1em;
overflow-x: auto;
overflow-y: padding;
}

article blockquote {
background: #fff;
border: dashed 1px #777;
border-left: solid 2px #777;
color: #000;
margin: 0;
padding: 0 0 0 1em;
}

article ul, article ol {
padding-left: 2em;
}

footer {
border-top: 1px solid #ccc;
font-size: 10pt;
margin-top: 4em;
}

@media (max-width: 768px) {

body {
padding: 0 10px 0 230px;
}

nav {
width: 230px;
}

}

@media (max-width: 480px) {

body {
padding: 64px 10px 0 10px;
}

header .banner {
display: none;
}

nav {
position: absolute;
width: 100%;
}

nav .menubar {
display: block;
}

nav .banner {
float: right;
}

nav ul {
background: #fff;
display: none;
font-size: 14pt;
margin: 0;
padding: 0 0 0 8px;
}

nav .level2 {
font-size: 16pt;
font-weight: bold;
}

nav li {
line-height: 240%;
}

.index nav ul {
display: block;
}

.index article {
display: none;
}

}
</style>
<script>
  (function (tags) {
    var i = 0, len = tags.length;

    for (; i < len; ++i) {
        document.createElement(tags[i]);
    }
  }([ 'header', 'nav', 'article', 'footer' ]));
</script>

<nav>
<div class="menubar">
<a class="button">&#9776;&nbsp;索引</a>
</div>
<ul>
<li class="level2"><a href="?f=1">NodeJS基础</a></li><li class="level3"><a href="?f=1.1">什么是NodeJS</a></li><li class="level3"><a href="?f=1.2">有啥用处</a></li><li class="level3"><a href="?f=1.3">如何安装</a></li><li class="level4"><a href="?f=1.3#1.3.1">安装程序</a></li><li class="level4"><a href="?f=1.3#1.3.2">编译安装</a></li><li class="level3"><a href="?f=1.4">如何运行</a></li><li class="level4"><a href="?f=1.4#1.4.1">权限问题</a></li><li class="level3"><a href="?f=1.5">模块</a></li><li class="level4"><a href="?f=1.5#1.5.1">require</a></li><li class="level4"><a href="?f=1.5#1.5.2">exports</a></li><li class="level4"><a href="?f=1.5#1.5.3">module</a></li><li class="level4"><a href="?f=1.5#1.5.4">模块初始化</a></li><li class="level4"><a href="?f=1.5#1.5.5">主模块</a></li><li class="level4"><a href="?f=1.5#1.5.6">完整示例</a></li><li class="level3"><a href="?f=1.6">二进制模块</a></li><li class="level3"><a href="?f=1.7">小结</a></li><li class="level2"><a href="?f=2">代码的组织和部署</a></li><li class="level3"><a href="?f=2.1">模块路径解析规则</a></li><li class="level3"><a href="?f=2.2">包（package）</a></li><li class="level4"><a href="?f=2.2#2.2.1">index.js</a></li><li class="level4"><a href="?f=2.2#2.2.2">package.json</a></li><li class="level3"><a href="?f=2.3">命令行程序</a></li><li class="level4"><a href="?f=2.3#2.3.1">Linux</a></li><li class="level4"><a href="?f=2.3#2.3.2">Windows</a></li><li class="level3"><a href="?f=2.4">工程目录</a></li><li class="level3"><a href="?f=2.5">NPM</a></li><li class="level4"><a href="?f=2.5#2.5.1">下载三方包</a></li><li class="level4"><a href="?f=2.5#2.5.2">安装命令行程序</a></li><li class="level4"><a href="?f=2.5#2.5.3">发布代码</a></li><li class="level4"><a href="?f=2.5#2.5.4">版本号</a></li><li class="level4"><a href="?f=2.5#2.5.5">灵机一点</a></li><li class="level3"><a href="?f=2.6">小结</a></li><li class="level2"><a href="?f=3">文件操作</a></li><li class="level3"><a href="?f=3.1">开门红</a></li><li class="level4"><a href="?f=3.1#3.1.1">小文件拷贝</a></li><li class="level4"><a href="?f=3.1#3.1.2">大文件拷贝</a></li><li class="level3"><a href="?f=3.2">API走马观花</a></li><li class="level4"><a href="?f=3.2#3.2.1">Buffer（数据块）</a></li><li class="level4"><a href="?f=3.2#3.2.2">Stream（数据流）</a></li><li class="level4"><a href="?f=3.2#3.2.3">File System（文件系统）</a></li><li class="level4"><a href="?f=3.2#3.2.4">Path（路径）</a></li><li class="level3"><a href="?f=3.3">遍历目录</a></li><li class="level4"><a href="?f=3.3#3.3.1">递归算法</a></li><li class="level4"><a href="?f=3.3#3.3.2">遍历算法</a></li><li class="level4"><a href="?f=3.3#3.3.3">同步遍历</a></li><li class="level4"><a href="?f=3.3#3.3.4">异步遍历</a></li><li class="level3"><a href="?f=3.4">文本编码</a></li><li class="level4"><a href="?f=3.4#3.4.1">BOM的移除</a></li><li class="level4"><a href="?f=3.4#3.4.2">GBK转UTF8</a></li><li class="level4"><a href="?f=3.4#3.4.3">单字节编码</a></li><li class="level3"><a href="?f=3.5">小结</a></li><li class="level2"><a href="?f=4">网络操作</a></li><li class="level3"><a href="?f=4.1">开门红</a></li><li class="level3"><a href="?f=4.2">API走马观花</a></li><li class="level4"><a href="?f=4.2#4.2.1">HTTP</a></li><li class="level4"><a href="?f=4.2#4.2.2">HTTPS</a></li><li class="level4"><a href="?f=4.2#4.2.3">URL</a></li><li class="level4"><a href="?f=4.2.4">Query String</a></li><li class="level4"><a href="?f=4.2.5">Zlib</a></li><li class="level4"><a href="?f=4.2.6">Net</a></li><li class="level3"><a href="?f=4.3">灵机一点</a></li><li class="level3"><a href="?f=4.4">小结</a></li><li class="level2"><a href="?f=5">进程管理</a></li><li class="level3"><a href="?f=5.1">开门红</a></li><li class="level3"><a href="?f=5.2">API走马观花</a></li><li class="level4"><a href="?f=5.2#5.2.1">Process</a></li><li class="level4"><a href="?f=5.2.2">Child Process</a></li><li class="level4"><a href="?f=5.2.3">Cluster</a></li><li class="level3"><a href="?f=5.3">应用场景</a></li><li class="level4"><a href="?f=5.3#5.3.1">如何获取命令行参数</a></li><li class="level4"><a href="?f=5.3#5.3.2">如何退出程序</a></li><li class="level4"><a href="?f=5.3#5.3.3">如何控制输入输出</a></li><li class="level4"><a href="?f=5.3#5.3.4">如何降权</a></li><li class="level4"><a href="?f=5.3#5.3.5">如何创建子进程</a></li><li class="level4"><a href="?f=5.3#5.3.6">进程间如何通讯</a></li><li class="level4"><a href="?f=5.3#5.3.7">如何守护子进程</a></li><li class="level3"><a href="?f=5.4">小结</a></li><li class="level2"><a href="?f=6">异步编程</a></li><li class="level3"><a href="?f=6.1">回调</a></li><li class="level3"><a href="?f=6.2">代码设计模式</a></li><li class="level4"><a href="?f=6.2#6.2.1">函数返回值</a></li><li class="level4"><a href="?f=6.2#6.2.2">遍历数组</a></li><li class="level4"><a href="?f=6.2#6.2.3">异常处理</a></li><li class="level3"><a href="?f=6.3">域（Domain）</a></li><li class="level4"><a href="?f=6.3#6.3.1">陷阱</a></li><li class="level3"><a href="?f=6.4">小结</a></li><li class="level2"><a href="?f=7">大示例</a></li><li class="level3"><a href="?f=7.1">需求</a></li><li class="level3"><a href="?f=7.2">第一次迭代</a></li><li class="level4"><a href="?f=7.2#7.2.1">设计</a></li><li class="level4"><a href="?f=7.2#7.2.2">实现</a></li><li class="level3"><a href="?f=7.3">第二次迭代</a></li><li class="level4"><a href="?f=7.3#7.3.1">设计</a></li><li class="level4"><a href="?f=7.3#7.3.2">实现</a></li><li class="level3"><a href="?f=7.4">第三次迭代</a></li><li class="level4"><a href="?f=7.4#7.4.1">设计</a></li><li class="level4"><a href="?f=7.4#7.4.2">实现</a></li><li class="level3"><a href="?f=7.5">第四次迭代</a></li><li class="level4"><a href="?f=7.5#7.5.1">设计</a></li><li class="level4"><a href="?f=7.5#7.5.2">实现</a></li><li class="level3"><a href="?f=7.6">后续迭代</a></li><li class="level3"><a href="?f=7.7">小结</a></li></ul>

</nav>
<article><?php 
$fn = "1.1";
if(isset($_GET["f"])) $fn = substr($_GET["f"],0,3);
if(strlen($fn) == 1) $fn .= ".1";
include($fn.".htm");
?></article>
<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-48219044-1', 'auto');
  ga('send', 'pageview');
</script>
<?php require("../include/foot.php");
